From d64f70fbc89e2cea6cbd95f5c3e3af437a3c2810 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Thu, 27 Mar 2025 14:31:51 +0700
Subject: bug fix price hemat di promotion

---
 src-migrate/pages/api/product-variant/[id].tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src-migrate/pages/api/product-variant/[id].tsx')

diff --git a/src-migrate/pages/api/product-variant/[id].tsx b/src-migrate/pages/api/product-variant/[id].tsx
index 2c46ac89..0f7524d0 100644
--- a/src-migrate/pages/api/product-variant/[id].tsx
+++ b/src-migrate/pages/api/product-variant/[id].tsx
@@ -6,7 +6,7 @@ const SOLR_HOST = process.env.SOLR_HOST as string
 
 export default async function handler(req: NextApiRequest, res: NextApiResponse) {
   const variantId = req.query.id as string
-  let price_tier = 'tier1'
+  let price_tier = 'tier1_v2'
 
   let auth = req.cookies.auth ? JSON.parse(req.cookies.auth) : null
   if (auth?.pricelist) price_tier = auth.pricelist
@@ -29,7 +29,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
 
 const map = async (variant: any, price_tier: string) => {
   const data: any = {}
-  const price = variant[`price_${price_tier}_v2_f`] || 0
+  const price = variant[`price_${price_tier}_f`] || 0
 
   data.id = parseInt(variant.id)
   data.parent_id = variant.template_id_i
-- 
cgit v1.2.3

